#ifndef __H_EVENTITEM_H__
#define __H_EVENTITEM_H__
#include <string>

enum EventId
{
	EVENT_ID_NONE = 0,
	EVENT_ID_1 = 1,
    EVENT_ID_2 = 2,
    EVENT_ID_3 = 3,
    EVENT_ID_4 = 4,
    EVENT_ID_5 = 5,
	EVENT_ID_6 = 6,
	EVENT_ID_7 = 7,
	EVENT_ID_8 = 8,
	EVENT_ID_9 = 9,
	EVENT_ID_10 = 10,
};
struct stEventItem
{
	EventId m_eventid;
	unsigned int m_cmd;
	unsigned short m_dsttype;
	unsigned int m_dstsid;
	unsigned short m_srctype;
	unsigned int m_srcsid;
	unsigned int m_mod_num;
	unsigned int m_agentid;
	unsigned int m_seq;
	std::string m_buff;
	bool m_encryp;

	stEventItem()
	{
		m_eventid = EVENT_ID_NONE;
		m_cmd = 0;
		m_dsttype = 0;
		m_dstsid = 0;
		m_srctype = 0;
		m_srcsid = 0;
		m_mod_num = 0;
		m_agentid = 0;
		m_encryp = false;
		m_seq = 0;
	}

	stEventItem(const stEventItem& other)
	{
		m_eventid = other.m_eventid;
		m_cmd = other.m_cmd;
		m_dsttype = other.m_dsttype;
		m_dstsid = other.m_dstsid;
		m_srctype = other.m_srctype;
		m_srcsid = other.m_srcsid;
		m_mod_num = other.m_mod_num;
		m_agentid = other.m_agentid;
		m_buff = other.m_buff;
		m_encryp = other.m_encryp;
		m_seq = other.m_seq;
	}

	stEventItem(stEventItem&& other) : m_buff(std::move(other.m_buff))
	{
		m_eventid = other.m_eventid;
		m_cmd = other.m_cmd;
		m_dsttype = other.m_dsttype;
		m_dstsid = other.m_dstsid;
		m_srctype = other.m_srctype;
		m_srcsid = other.m_srcsid;
		m_mod_num = other.m_mod_num;
		m_agentid = other.m_agentid;
		//m_buff.swap(item.m_buff);
		m_encryp = other.m_encryp;
		m_seq = other.m_seq;
	}

	stEventItem& operator = (const stEventItem& other)
	{
		if (this == &other)
			return *this;

		m_eventid = other.m_eventid;
		m_cmd = other.m_cmd;
		m_dsttype = other.m_dsttype;
		m_dstsid = other.m_dstsid;
		m_srctype = other.m_srctype;
		m_srcsid = other.m_srcsid;
		m_mod_num = other.m_mod_num;
		m_agentid = other.m_agentid;
		m_buff = other.m_buff;
		m_encryp = other.m_encryp;
		m_seq = other.m_seq;

		return *this;
	}

	stEventItem& operator = (stEventItem&& other)
	{
		if (this == &other)
			return *this;

		m_eventid = other.m_eventid;
		m_cmd = other.m_cmd;
		m_dsttype = other.m_dsttype;
		m_dstsid = other.m_dstsid;
		m_agentid = other.m_agentid;
		m_srctype = other.m_srctype;
		m_srcsid = other.m_srcsid;
		m_mod_num = other.m_mod_num;
		m_buff = std::move(other.m_buff);
		m_encryp = other.m_encryp;
		m_seq = other.m_seq;

		return *this;
	}
};
#endif
